-- card: 2912 from stack: in -- bmap block id: 0 -- flags: 0000 -- background id: 2589 -- name: Cursor Demo ----- HyperTalk script ----- on closeCard SetCursor mouse end closeCard on arrowKey arb visual effect iris close slow go card 1 end arrowKey -- part 1 (button) -- low flags: 00 -- high flags: 8003 -- rect: left=4 top=41 right=63 bottom=104 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Demo 1 ----- HyperTalk script ----- on mouseUp setCursor loc of button "Demo 2" end mouseUp -- part 2 (button) -- low flags: 00 -- high flags: 8003 -- rect: left=4 top=98 right=120 bottom=104 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Demo 2 ----- HyperTalk script ----- on mouseUp SetCursor free SetCursor topleft of card field "Demo 2" wait 180 SetCursor bottomright of card field "Demo 2" wait 120 SetCursor reset end mouseUp -- part 4 (button) -- low flags: 00 -- high flags: 8003 -- rect: left=402 top=271 right=293 bottom=502 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Wander ----- HyperTalk script ----- on mouseWithin put the mouseH + random(3) - 2 into h put the mouseV + random(3) - 2 into v SetCursor h,v end mouseWithin -- part 5 (button) -- low flags: 00 -- high flags: 8003 -- rect: left=402 top=299 right=321 bottom=503 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Bounce ----- HyperTalk script ----- on mouseEnter global hdelta, vdelta put 1 into hdelta put 1 into vdelta end mouseEnter on mouseWithin global hdelta, vdelta put the mouseH into h put the mouseV into v if (hdelta = 1) and (h = right of me - 1) then put -1 into hdelta else if (hdelta = -1) and (h = left of me) then put 1 into hdelta end if if (vdelta = 1) and (v = bottom of me - 1) then put -1 into vdelta else if (vdelta = -1) and (v = top of me) then put 1 into vdelta end if SetCursor h+hdelta,v+vdelta end mouseWithin -- part 6 (button) -- low flags: 00 -- high flags: 0001 -- rect: left=6 top=299 right=328 bottom=37 -- title width / last selected line: 0 -- icon id / first selected line: 1012 / 1012 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: New Button ----- HyperTalk script ----- on mouseUp visual effect iris close slow go card 1 end mouseUp -- part 7 (field) -- low flags: 01 -- high flags: 0004 -- rect: left=108 top=41 right=93 bottom=508 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Move -- part 8 (field) -- low flags: 01 -- high flags: 0004 -- rect: left=108 top=98 right=265 bottom=509 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Demo 2 -- part 9 (field) -- low flags: 01 -- high flags: 0004 -- rect: left=108 top=270 right=307 bottom=396 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: -- part contents for card part 7 ----- text ----- If you push the button to the left, the cursor will jump to the next demo… It does this by issuing: SetCursor loc of button "Demo 2" -- part contents for card part 8 ----- text ----- On pushing the button to the left the cursor is freed from the mouse and jumps to the top left corner of this field — try moving the mouse… After a few seconds the cursor will jump to the bottom right of this field, pause again and then return back to the button by issuing a "SetCursor reset". WARNING: If you abort the button script by typing "Command-." your cursor and mouse will be decoupled! To avoid embarrassment to those of you who are bound to try it, the closeCard handler issues a "SetCursor mouse" (which does nothing if they are coupled). -- part contents for card part 9 ----- text ----- If you're not yet bored, try leaving the mouse over one of the buttons on the right…